package a.g;

import a.c.k;
import a.c.m;
import a.f.e.c;
import a.f.hd;
import a.f.id;
import a.f.qc;
import a.f.xb;
import a.h.dc;
import a.h.sd;
import a.h.z;
import a.i.p;
import a.j.*;

import java.util.Map;

public class g
  extends f
{
  private static final String d = "ALLOW_NODE_OVERLAPS";
  private static final String h = "INPUT";
  private static final String q = "CONSIDER_INVISIBLE_LABELS";
  private static final String r = "ALLOW_EDGE_OVERLAPS";
  private static final String s = "DIVERSE_LABELING";
  private static final String t = "QUALITY";
  private static final String u = "USE_OPTIMIZATION";
  private static final String v = "USE_POSTPROCESSING";
  private static final String w = "CONSIDER_SELECTED_FEATURES_ONLY";
  private static final String x = "SCOPE";
  private static final String y = "PLACE_EDGE_LABELS";
  private static final String z = "MODEL";
  private static final String A = "EDGE_LABEL_MODEL";
  private static final String B = "AUTO_ROTATE";
  private static final String C = "UNKNOWN_MODEL_VALUE";
  private static final String D = "PLACE_NODE_LABELS";
  private static final String E = "OPTIMIZATION_BALANCED";
  private static final String F = "OPTIMIZATION_NODE_OVERLAP";
  private static final String G = "OPTIMIZATION_LABEL_OVERLAP";
  private static final String H = "OPTIMIZATION_EDGE_OVERLAP";
  private static final String I = "OPTIMIZATION_NONE";
  private static final String J = "OPTIMIZATION_STRATEGY";
  private static final String K = "As Is";
  private static final String L = "Best";
  private static final String[] M = { "OPTIMIZATION_BALANCED", "OPTIMIZATION_NONE", "OPTIMIZATION_EDGE_OVERLAP", "OPTIMIZATION_LABEL_OVERLAP", "OPTIMIZATION_NODE_OVERLAP" };
  public static int N;
  
  public g()
  {
    super("DIVERSE_LABELING", "yFiles Layout Team", "Places Labels");
  }
  
  protected dc j()
  {
    dc localdc = new dc(a());
    localdc.l("SCOPE");
    localdc.a("PLACE_NODE_LABELS", true);
    localdc.a("PLACE_EDGE_LABELS", true);
    localdc.a("CONSIDER_SELECTED_FEATURES_ONLY", false);
    localdc.a("CONSIDER_INVISIBLE_LABELS", false);
    localdc.l("QUALITY");
    localdc.a("USE_OPTIMIZATION", false);
    localdc.a("OPTIMIZATION_STRATEGY", M, 0);
    localdc.a("ALLOW_NODE_OVERLAPS", false);
    localdc.a("ALLOW_EDGE_OVERLAPS", true);
    localdc.a("USE_POSTPROCESSING", false);
    localdc.l("MODEL");
    Map localMap = ig.hb();
    String str1 = "As Is";
    localMap.put(str1, str1);
    String str2 = "Best";
    localMap.put(str2, str2);
    localdc.a("EDGE_LABEL_MODEL", localMap.keySet().toArray(), str2, new sd(localMap));
    localdc.a("AUTO_ROTATE", false);
    z localz = new z(localdc);
    Object[] arrayOfObject = { "As Is", "Best", new Byte(4) };
    z.t_ localt_ = localz.a("EDGE_LABEL_MODEL", arrayOfObject);
    localz.a(localt_.a(), localdc.k("AUTO_ROTATE"));
    return localdc;
  }
  
  protected void m()
  {
    dc localdc = i();
    a_ locala_ = new a_(e(), localdc.g("CONSIDER_SELECTED_FEATURES_ONLY"), localdc.g("PLACE_NODE_LABELS"), localdc.g("PLACE_EDGE_LABELS"), localdc.g("CONSIDER_INVISIBLE_LABELS"));
    e().a("INPUT", locala_);
    a(localdc.j("EDGE_LABEL_MODEL"), locala_, localdc.g("AUTO_ROTATE"));
  }
  
  protected void n()
  {
    int i = f.p;
    dc localdc = i();
    c localc = localdc.g("USE_OPTIMIZATION") ? new a.f.e.d() : new c();
    localc.h(true);
    localc.a((byte)localdc.i("OPTIMIZATION_STRATEGY"));
    if (i == 0) {
      if (localc.p() == 4) {
        localc.a(new qc());
      }
    }
    if (i == 0) {}
    localc.d(!localdc.g("ALLOW_NODE_OVERLAPS"));
    if (i == 0) {}
    localc.e(!localdc.g("ALLOW_EDGE_OVERLAPS"));
    localc.b(localdc.g("USE_POSTPROCESSING"));
    localc.a("INPUT");
    ec localec = new ec((byte)0);
    pg localpg = g();
    if (i == 0)
    {
      if (localpg == null) {
        localec.a(e(), localc);
      }
    }
    else
    {
      if (i != 0) {
        return;
      }
      if (!f.o) {
        break label191;
      }
    }
    localec.b(localpg, localc);
    label191:
    e().j("INPUT");
    e().gb();
  }
  
  static xb a(byte paramByte)
  {
    int i = f.p;
    boolean bool = f.o;
    Object localObject;
    if (i == 0) {
      if (1 == paramByte)
      {
        localObject = new hd(128);
        if (i != 0) {
          break label218;
        }
        ((hd)localObject).b(true);
        if (!bool) {
          return localObject;
        }
      }
    }
    if (i == 0) {
      if (0 == paramByte)
      {
        localObject = new hd(18);
        if (i != 0) {
          break label218;
        }
        ((hd)localObject).b(true);
        if (!bool) {
          return localObject;
        }
      }
    }
    if (i == 0) {
      if (2 == paramByte)
      {
        localObject = new hd(63);
        if (i != 0) {
          break label218;
        }
        ((hd)localObject).b(true);
        if (!bool) {
          return localObject;
        }
      }
    }
    if (i == 0) {
      if (3 == paramByte)
      {
        localObject = new hd(448);
        if (i != 0) {
          break label218;
        }
        ((hd)localObject).b(true);
        if (!bool) {
          return localObject;
        }
      }
    }
    if (i == 0) {
      if (5 == paramByte)
      {
        localObject = new id((byte)0);
        if (i != 0) {
          break label218;
        }
        ((id)localObject).b(true);
        if (!bool) {
          return localObject;
        }
      }
    }
    if (6 == paramByte)
    {
      localObject = new id((byte)1);
      if (i != 0) {
        break label218;
      }
      ((id)localObject).b(true);
      if (!bool) {}
    }
    else
    {
      localObject = null;
    }
    label218:
    return localObject;
  }
  
  void a(Object paramObject, k paramk, boolean paramBoolean)
  {
    int j = f.p;
    boolean bool = f.o;
    if ("As Is".equals(paramObject)) {
      return;
    }
    xb localxb = null;
    byte b;
    if (j == 0) {
      if ("Best".equals(paramObject))
      {
        b = 4;
        if ((j == 0) && (!bool)) {
          break label117;
        }
      }
    }
    if ((j != 0) || ((paramObject instanceof Byte)))
    {
      b = ((Byte)paramObject).byteValue();
      if ((j != 0) || (paramBoolean)) {
        localxb = a(b);
      }
    }
    else
    {
      throw new IllegalArgumentException("UNKNOWN_MODEL_VALUE" + paramObject);
    }
    label117:
    a.j.g localg = e();
    m localm = localg.w();
    label255:
    do
    {
      if (!localm.e()) {
        break;
      }
      a.c.d locald = localm.a();
      tb localtb = localg.t(locald);
      int i = 0;
      do
      {
        do
        {
          if (i >= localtb.V()) {
            break label255;
          }
          ig localig = localtb.d(i);
          if (bool) {
            break;
          }
          if (paramk.getBool(localig)) {
            if (localxb != null)
            {
              localig.a(localxb, localxb.a());
              if (j != 0) {
                continue;
              }
              if (!bool) {}
            }
            else
            {
              localig.e(b);
              localig.a(localig.a().a());
            }
          }
          i++;
        } while (!bool);
        localm.f();
      } while (j != 0);
    } while (!bool);
  }
  
  static class a_
    extends p
  {
    private final boolean c;
    private final a.j.g d;
    private final boolean e;
    private final boolean f;
    private final boolean g;
    
    a_(a.j.g paramg, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3, boolean paramBoolean4)
    {
      this.c = paramBoolean1;
      this.d = paramg;
      this.e = paramBoolean2;
      this.f = paramBoolean3;
      this.g = paramBoolean4;
    }
    
    public boolean getBool(Object paramObject)
    {
      int i = f.p;
      hg localhg = (hg)paramObject;
      if (i == 0) {
        if (!localhg.B())
        {
          if (i != 0) {
            break label40;
          }
          if (!this.g) {
            return false;
          }
        }
      }
      label40:
      Object localObject;
      if (i == 0) {
        if ((paramObject instanceof jg))
        {
          localObject = (jg)paramObject;
          if (i != 0) {
            break label72;
          }
          if (((jg)localObject).D() == 1) {
            return false;
          }
        }
      }
      label72:
      if (i == 0) {
        if (this.c)
        {
          if (i == 0) {
            if ((paramObject instanceof jg))
            {
              if (i != 0) {
                break label136;
              }
              if (this.e)
              {
                localObject = (jg)paramObject;
                if (i == 0) {
                  if (this.d.y(((jg)localObject).gb())) {
                    return true;
                  }
                }
                return false;
              }
            }
          }
          if (i == 0) {
            if ((paramObject instanceof ig))
            {
              if (i != 0) {
                break label185;
              }
              if (this.f)
              {
                localObject = (ig)paramObject;
                if (i == 0) {
                  if (this.d.v(((ig)localObject).lb())) {
                    return true;
                  }
                }
                return false;
              }
            }
          }
          return false;
        }
      }
      label136:
      label185:
      if (i == 0) {
        if ((paramObject instanceof jg))
        {
          if (i != 0) {
            break label216;
          }
          if (this.e) {
            return true;
          }
        }
      }
      label216:
      if (i == 0) {
        if ((paramObject instanceof ig))
        {
          if (i != 0) {
            break label239;
          }
          if (this.f) {
            return true;
          }
        }
      }
      label239:
      return false;
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.g.g

 * JD-Core Version:    0.7.0.1

 */